#include<bits/stdc++.h>

using namespace std;

struct sumNode {
	char arr = '0';
	int cot = 0;
};

struct sum {
	sumNode str[26] ;
	int size = 0;
};

int Find(sum s1, char c) {
	for (int i = 0 ; i < 26 ; i++) {
		if (s1.str[i].arr == c) {
			return i;
		}
	}
	return 0;
}

int main() {
	sum s1;
	char c;
	for (int i = 0 ; i < 26 ; i++) {
		s1.str[i].arr = 'A' + i;
	}
	while ((c = getchar()) != '\n') {
		if (c >= 'A' && c <= 'Z') {
			int ret = Find(s1, c);
			s1.str[ret].cot++;
		} else {
			printf("error\n");
		}
		s1.size++;
	}
	int max = 0;
	for (int i = 0 ; i < 26 ; i++) {
		if (s1.str[i].cot >= max) max = s1.str[i].cot;
	}
	for (int i = 0 ; i < 26 ; i++) {
		if (s1.str[i].cot == max) {
			printf("%c", s1.str[i].arr);
		}
	}
	return 0;
}
